<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

<f:view>
<f:loadBundle var="text" basename="#{creditForm.bundleName}"/>
<h:head>
    <title>#{text['creditDetail.title']}</title>
    <meta name="heading" content="#{text['creditDetail.heading']}"/>
    <meta name="menu" content="VenteMenu"/>
</h:head>

<c:set var="delObject" value="#{text['creditList.credit']}"/>
<script type="text/javascript">var msgDelConfirm =
   "<h:outputFormat value="#{text['delete.confirm']}"><f:param value="#{delObject}" /></h:outputFormat>";
</script>

<div class="span2">
    <h2>#{text['creditDetail.heading']}</h2>
</div>
<div class="span7">
<h:form id="creditForm" styleClass="well form-horizontal">
<div class="control-group">
    <h:inputHidden value="#{creditForm.credit.id}" id="id"/>
</div>
<div class="control-group">
    <h:outputLabel styleClass="control-label" for="avance" value="#{text['credit.avance']}"/>
    <div class="controls">
        <h:inputText id="avance" value="#{creditForm.credit.avance}" required="false" maxlength="255"/>
        <p:message for="avance"/>
    </div>
</div>
<div class="control-group">
    <div class="controls">
        <!-- todo: change this to read the identifier field from the other pojo -->
        <h:selectOneMenu value="#{creditForm.credit.client}" id="client" required="true" styleClass="select">
            <f:selectItems value="#{creditForm.credit.client}"/>
        </h:selectOneMenu>
        <p:message for="client"/>
    </div>
</div>
<div class="control-group">
    <div class="controls">
        <!-- todo: change this to read the identifier field from the other pojo -->
        <h:selectOneMenu value="#{creditForm.credit.commande}" id="commande" required="true" styleClass="select">
            <f:selectItems value="#{creditForm.credit.commande}"/>
        </h:selectOneMenu>
        <p:message for="commande"/>
    </div>
</div>
<div class="control-group">
    <h:outputLabel styleClass="control-label" for="dateCredit" value="#{text['credit.dateCredit']}"/>
    <div class="controls">
        <h:inputText id="dateCredit" value="#{creditForm.credit.dateCredit}" required="false">
            <f:convertDateTime pattern="#{text['date.format']}"/>
        </h:inputText>
        <p:message for="dateCredit"/>
    </div>
</div>
<div class="control-group">
    <h:outputLabel styleClass="control-label" for="reste" value="#{text['credit.reste']}"/>
    <div class="controls">
        <h:inputText id="reste" value="#{creditForm.credit.reste}" required="false" maxlength="255"/>
        <p:message for="reste"/>
    </div>
</div>
    <div class="form-actions">
        <h:commandButton value="#{text['button.save']}" action="#{creditForm.save}"
            id="save" styleClass="btn btn-primary"/>

            <h:commandButton value="#{text['button.delete']}" action="#{creditForm.delete}"
                id="delete" styleClass="btn" onclick="return confirmMessage(msgDelConfirm)"/>

        <h:commandButton value="#{text['button.cancel']}" action="cancel" immediate="true"
            id="cancel" styleClass="btn"/>
    </div>
</h:form>
</div>
</f:view>
</html>
